﻿using System;
using System.Runtime.Serialization;

namespace PH.Model.Standards
{
    [DataContract]
    public class EBMIModel:MBase
    {
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public int ID { get; set; }
        [Model]
        [DataMember]
        public int GradeCode { get; set; }
        [Model]
        [DataMember]
        public byte Sex { get; set; }
        [Model]
        [DataMember]
        public decimal Min { get; set; }
        [Model]
        [DataMember]
        public decimal Max { get; set; }
        [Model]
        [DataMember]
        public int Score { get; set; }
        [DataMember]
        public string Level
        {
            get
            {
                if (Score == 100)
                    return "正常";
                else if (Score == 80){
                    if (Min == 0)
                        return "低体重";
                    else
                        return "超重";
                }
                else
                    return "肥胖";
            }
        }
    }

    [DataContract]
    public class EBMICollection : ModelCollectionBase<EBMIModel> { }
}
